[GtkFileChooserDefault] Don't destroy and re-create the filename entry
authorFederico Mena Quintero <federico@gnome.org>
Tue, 29 Nov 2011 21:08:25 +0000 (15:08 -0600)
committerFederico Mena Quintero <federico@gnome.org>
Tue, 29 Nov 2011 21:11:56 +0000 (15:11 -0600)
This is a leftover from the big rework to remove the expanded/collapsed mode
in Save mode.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
gtk/gtkfilechooserdefault.c

index e83411479ac0dedc5310c5cb6b23170cad417757..f5e08c767e92c471f0f57cf284101000bca7177c 100644 (file)
@@ -4664,21 +4664,18 @@ location_switch_to_filename_entry (GtkFileChooserDefault *impl)
       impl->operation_mode == OPERATION_MODE_RECENT)
     return;
 
-  if (impl->location_entry)
-    {
-      gtk_widget_destroy (impl->location_entry);
-      impl->location_entry = NULL;
-    }
-
   /* Box */
 
   gtk_widget_show (impl->location_entry_box);
 
   /* Entry */
 
-  location_entry_create (impl);
-  gtk_box_pack_start (GTK_BOX (impl->location_entry_box), impl->location_entry, TRUE, TRUE, 0);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (impl->location_label), impl->location_entry);
+  if (!impl->location_entry)
+    {
+      location_entry_create (impl);
+      gtk_box_pack_start (GTK_BOX (impl->location_entry_box), impl->location_entry, TRUE, TRUE, 0);
+      gtk_label_set_mnemonic_widget (GTK_LABEL (impl->location_label), impl->location_entry);
+    }
 
   /* Configure the entry */